<div class="post">
    <div class="post-author">
        <div class="post-author-avatar">
            <img src="/img/users_avatar/<%= post.author.avatar%>" alt="" class="img-author-avatar">
        </div>
        <div class="post-author-name">
            <span class="text-author-name"><%= post.author.name%></span>
        </div>
    </div>
    <div class="post-content">
        <div class="post-content-header">
            <span class="text-post-title"><%= post.title%></span>
            <span class="text-post-detail">阅读(<%= post.pv%>)</span>
            <span class="text-post-detail">评论(<%= post.commentsCount%>)</span>
            <span class="text-post-detail"><%= post.created_at%></span>
            <span class="post-edit">
                    <% if (user && post.author._id && user._id.toString() === post.author._id.toString()) { %>
                    <div class="ui inline dropdown">
                        <div class="text">菜单</div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <div class="item"><a href="/posts/<%= post._id %>/edit">编辑</a></div>
                            <div class="item"><a href="/posts/<%= post._id %>/remove">删除</a></div>
                        </div>
                    </div>
                    <% }
                    else if (user && user.identity.toString()==='admin') { %>
                        <div class="ui inline dropdown">
                            <div class="text">菜单</div>                           
                            <i class="dropdown icon"></i>
                            <div class="menu">
                                <div class="item"><a href="/posts/<%= post._id %>/remove">删除</a></div>
                            </div>
                        </div>
                    <% } %>
                </span>
        </div>
        <div class="post-content-body">
            <div class="text-post-content">
                <%- post.content%>
            </div>
        </div>
    </div>
</div>
